<?php
if (!defined('IN_ZWS')) exit();

class UserResetModel extends Model {
	protected $tableName = 'User';
	protected $_validate = array(
		array('username', 'require', '用户名不能为空！', 0),
		array('password', 'require', '密码不能为空！', 0),
		array('password', '/^[\w~!@#$%^&*()_+{}:"<>?\-=[\];\',.\/]{8,16}$/', '密码格式不正确！必须由8-6位常用字符（不含空格）组成', 0, 'regex'),
		);

	protected $_auto = array(
		array('ip', 'getIp', 1, 'callback'),
		array('time', 'time', 1, 'function'),
		);

	function checklen($data) {
		return (strlen($data) > 15 || strlen($data) < 5)?false:true;
	}

	function getData() {
		return $this -> data;
	}

	function getIp() {
		return $_SERVER['REMOTE_ADDR'];
	}
}
